'use strict';

const {
	log
} = require("console");

const db = uniCloud.database();
exports.main = async (event, context) => {
	if (!event._id) {
		return {
			code: 400,
			message: "删除失败"
		}
	} else {
		let res = await db.collection(event.name).where({_id:event._id}).remove()
		return {
			data: "删除成功",
			code: 200
		}
	}
	// return "著那是没写"

	//访问微信云数据库
	//1.调用获取默认环境的数据库的引用：
};
